home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group93a.txt / 000034_icon-group-sender _Tue Jan 19 13:52:49 1993.msg < prev    next >
Internet Message Format  |  1993-04-21  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Tue, 19 Jan 1993 06:26:55 MST
  2. Date: Tue, 19 Jan 1993 13:52:49 +0100
  3. From: sperber@soir.informatik.uni-tuebingen.de (Michael Sperber)
  4. Message-Id: <9301191252.AA09689@soir.informatik.uni-tuebingen.de>
  5. To: sbw@turing.cse.nau.edu
  6. Cc: icon-group@cs.arizona.edu
  7. In-Reply-To: Steve Wampler's message of Mon, 18 Jan 1993 08:43:05 MST <9301181543.AA01233@turing.cse.nau.edu>
  8. Subject: Pattern matching in Icon?
  9. Status: R
  10. Errors-To: icon-group-errors@cs.arizona.edu
  11.  
  12. Finally, it seems I've been able to get through with the essence of my
  13. proposal.  Sorry for all the confusion; it's probably that I'm working
  14. on a compiler project right now that is written in SML.  Pattern
  15. matching is just humungously convenient for syntax transformation.
  16. I'm sorry if the impression was that I wanted pattern matching in the
  17. core language of Icon - as I said, a variant translator would
  18. probably be closest to what I want.  However, since it's stated so
  19. often that Icon is aimed at compiler writing, I thought that others
  20. might have already done some thinking on the matter:  I guess it's the
  21. generators that make Icon convenient for compiler writing, but
  22. actually, that's EXACTLY what the functional-language people say of
  23. pattern matching in their languages.  Now, Steve Wampler writes:
  24.  
  25. >You find adding two assignment operators to your original syntax
  26. >'extremely' awkward?  Why?  More awkward, yes.  But I don't see
  27. >that as 'extremely'!  Or is that you're writing your own pattern
  28. >matching function(s) that you see as awkward?  Again, you write them
  29. >once, hide them away in a library, and presto, no difference there
  30. >with having them built into the language -- except that you can
  31. >*change* them!
  32.  
  33. The code itself is not that complicated.  However,  the advantage of
  34. pattern matching is that you usually specifiy lots of
  35. differently-structured (and recursive invokations) patterns in a
  36. single case.  Since for EVERY record constructor and for EVERY
  37. structural variant of patterns that you use, you'd need to write a
  38. different matching function, indeed things would typically get very
  39. bothersome:  You cannot just intuitively add patterns to a case
  40. without thinking about how the matching procedure for the specific
  41. structural variant is called and how it's invoked.  So I contend: Yes,
  42. VERY awkward.
  43.  
  44. Cheers :-> Chipsy  
  45.